package com.xy.biz.fd.domain.converter;

import com.xy.biz.fd.domain.bo.DocumentBO;
import com.xy.biz.fd.domain.bo.FolderBO;
import com.xy.biz.fd.domain.resp.GetDocumentResponse;
import com.xy.biz.fd.domain.resp.GetFileExtensionResponse;
import com.xy.tool.util.BeanUtilsEx;

import java.util.Collection;
import java.util.List;

/**
 * @author Greekn Zhang
 * @date 2021/5/8 18:29
 * @description
 */
public class FileExtensionConverter {
    public static List<GetFileExtensionResponse> toResponse(Collection<DocumentBO> source) {
        return BeanUtilsEx.copyPropertiesForNewList(source, GetFileExtensionResponse::new);
    }
    public static GetFileExtensionResponse toResponse(DocumentBO source) {
        return BeanUtilsEx.copyProperties(source, GetFileExtensionResponse::new);
    }
    public static GetFileExtensionResponse toResponse(FolderBO source) {
        return BeanUtilsEx.copyProperties(source, GetFileExtensionResponse::new);
    }
}
